package com.basic;

import com.business.socialcredit.SocialCreditFactory;
import com.frame.struts.BaseBean;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.utils.CommUtil;
import com.utils.ConnectionManager;

import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;

public class HgForm extends BaseBean 
{
	private static final long serialVersionUID = 1L;
	
	private String qyid			="";
	
	private String ywzyjkjyq ;
	private String qdsj ;
	private String bh ;
	private String yxq ;
	private String jcjl ;
    
    private String optrid			="";	
    private Date 	optdate	=new Date();
    private String remark="";
    private String 	recstate	="";
    
    
   
    
    public HgForm() 
	{
    }
	
	public String addHg() {
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		this.setQyid(qyid);
		this.setOptdate(new Date());
		this.setOptrid(CommUtil.getUserId(request));
		
		if (factory.addHg(this)) 
		{
				return "success";
		}else
		{
			return "failed";
		}
		
	}

	public String modifyHg() {
		HttpServletRequest request = ActionContext.getActionContext().getRequest();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		
		Deletion d=new Deletion("qy_hgxx",new String[]{"qyid"},new Object[]{qyid});
		factory.delete(d);
		
		this.setQyid(qyid);
		this.setOptdate(new Date());
		this.setOptrid(CommUtil.getUserId(request));
		
		if (factory.addHg(this))
		{
				return "success";
		}else
		{
			return "failed";
		}
	}

	

	public String getYwzyjkjyq() {
		return ywzyjkjyq;
	}

	public void setYwzyjkjyq(String ywzyjkjyq) {
		this.ywzyjkjyq = ywzyjkjyq;
	}

	public String getQdsj() {
		return qdsj;
	}

	public void setQdsj(String qdsj) {
		this.qdsj = qdsj;
	}

	public String getBh() {
		return bh;
	}

	public void setBh(String bh) {
		this.bh = bh;
	}

	public String getJcjl() {
		return jcjl;
	}

	public void setJcjl(String jcjl) {
		this.jcjl = jcjl;
	}

	public String getQyid() {
		return qyid;
	}

	public void setQyid(String qyid) {
		this.qyid = qyid;
	}

	public String getYxq() {
		return yxq;
	}

	public void setYxq(String yxq) {
		this.yxq = yxq;
	}

	public String getOptrid() {
		return optrid;
	}

	public void setOptrid(String optrid) {
		this.optrid = optrid;
	}

	public Date getOptdate() {
		return optdate;
	}

	public void setOptdate(Date optdate) {
		this.optdate = optdate;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getRecstate() {
		return recstate;
	}

	public void setRecstate(String recstate) {
		this.recstate = recstate;
	}
	
	
  
	          
}
